<?php

namespace App\Http\Controllers;

use App\Http\Controllers\Controller;
use App\Models\Article;
use Illuminate\Http\Request;
use App\Models\Column;
use Illuminate\Support\Facades\Cache;
use Jenssegers\Agent\Agent as Agent;
class TestController extends Controller
{
    
    public function index(Request $request)
    {
        $client = new \GuzzleHttp\Client();
		$res = $client->request('GET', 'http://apitest.zhoukearts.com/');
		$ret = json_decode($res->getBody());
		
		foreach($ret as $row)
		{
			$Column = new Column();
			$Column->id = $row->id;
			$Column->name = $row->title;
			$Column->save();
		}
		return $ret;
    }
    
    
}


